import scala.io.StdIn
def avg_fun(list:List[Int],n:Int):Double={
  val filteredList=list.filter(_<n)
  if (filteredList.isEmpty){
    0
  }else{
    filteredList.sum.toDouble/filteredList.length.toDouble
  }
}

val list:List[Int]=List(15,58,125,0,1,5,87,96)
print("please enter a positive integer:")
val n=readInt()
avg_fun(list,n)
